package ua.dogar.sockets;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.net.ServerSocket;
import java.net.Socket;

import ua.dogar.test.*;
import ua.dogar.vectors.Vector;

public class MyServerSocket {
	
	public static void main(String[] args) throws IOException {
	  ServerSocket serSock;
	  Socket clientSock;

		serSock = new ServerSocket(7843);
		Vector vec1;
		clientSock = serSock.accept();
		while((vec1 =Vectors.inputVector(clientSock.getInputStream()))!=null){
		Vector vec2 =Vectors.inputVector(clientSock.getInputStream());
		Vectors.outputVector( Vectors.addVectors(vec1, vec2),clientSock.getOutputStream()) ;
		}
		
		serSock.close();
	}
}
